from xml.etree.ElementTree import parse

dic = {}

doc = parse('hangye.xml')
for option in doc.getroot():
    name = option.text
    value = option.get('value')
    dic[name] = value

def getKeyByName(name):
    return dic[name]
